import time
class FilmSelector:
    def display_options(self,films):
        print("今日影院排片列表：")
        print("+===================+")
        for i in range(len(films)):
            print("{}_{}".format(i+1, films[i]["name"]))
            time.sleep(0.2)
        print("x - 退出")
        print("+===================+")

    def get_choice(self,films):
        vaild_choice = [str(i+1) for i in range(len(films))]
        vaild_choice.append("x")
        choice = input("你的选择是：")
        while choice not in vaild_choice:
            choice = input("，没有按照要求输入，请重新输入")
        return choice
